/**
 * 本地后端地址
 */

// function getBaseUrl() {
//   const url = window.location.href.toString();
//   let baseUrl = url.split('#')[0];
//   if (baseUrl.endsWith('/')) {
//     baseUrl = baseUrl.substring(0, baseUrl.length - 1);
//   }
//   return baseUrl;
// }

// export const BACKEND_HOST_LOCAL = 'http://' + window.location.host;
// export const BACKEND_HOST_LOCAL = 'http://192.168.100.67:8888';
export const BACKEND_HOST_LOCAL = 'http://localhost:8101';
// export const BACKEND_HOST_LOCAL = window.location.protocol + '//' + window.location.host;

/**
 * 线上后端地址
 */
export const BACKEND_HOST_PROD = window.location.protocol + '//' + window.location.host;

export const BACKEND_HOST =
  process.env.NODE_ENV === 'production' ? BACKEND_HOST_PROD : BACKEND_HOST_LOCAL;
// export const BACKEND_HOST_PROD = 'http://localhost:8101';
// export const BACKEND_HOST_PROD = 'http://192.168.2.60:8888';
